package test;

import java.util.Scanner;

/**
 * @author 美女
 * @date 2022/08/27 20:23
 **/
public class test2 {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        //仅有大小写字母组成的字符串
        String s=sc.next();
        //前k个大写
        StringBuilder sb=new StringBuilder();
        for(int i=0;i<s.length();i++){
            char ch=s.charAt(i);
            if(i<k){
                if(ch>='a'&&ch<='z'){
                    ch=(char)(ch+('A'-'a'));
                }
                sb.append(ch);
            }else{
                if(ch>='A'&&ch<='Z'){
                    ch=(char)(ch-('A'-'a'));
                }
                sb.append(ch);
            }
        }
        System.out.println(sb.toString());
    }
}
